﻿<phone:PhoneApplicationPage 
    x:Class="NASA.BeAMartian.Views.Learn.QuestionPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d" d:DesignHeight="768" d:DesignWidth="480"
    shell:SystemTray.IsVisible="False">


    <!--Data context is set to sample data above and first item in sample data collection below-->
    <Grid x:Name="LayoutRoot"  d:DataContext="{Binding Items[0]}">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!--TitleGrid is the name of the application and page title-->
        <Image Source="/NASA.BeAMartian;component/Assets/Images/blk.png" Stretch="Fill" Grid.RowSpan="2"/>
        <Image Source="/NASA.BeAMartian;component/Assets/Images/399-260508-2204-6-3d-2-01-EchusChasma_L.jpg" Stretch="Fill" Grid.RowSpan="2" Opacity="0.4"/>

        <!--TitleGrid is the name of the application and page title-->
        <Grid x:Name="TitleGrid" Grid.Row="0">
            <Grid.Projection>
                <PlaneProjection/>
            </Grid.Projection>

            <TextBlock x:Name="tbPageTitle" Style="{StaticResource PhoneTextPageTitle1Style}"/>
            <TextBlock  Text="question" Style="{StaticResource PhoneTextPageTitle2Style}"/>
        </Grid>

        <!--ContentGrid contains the details-->
        <Grid x:Name="ContentGrid" Grid.Row="1">
            <Grid.Projection>
                <PlaneProjection/>
            </Grid.Projection>

            <TextBlock x:Name="tbQuestionBody" Text="{Binding Body}" Style="{StaticResource PhoneTextBodyTextStyle}" Margin="128,123,8,369" />
            <!--<Button Content="Post a Response" Height="70" HorizontalAlignment="Left" Margin="20,539,0,0" Name="btnPostAResponse" VerticalAlignment="Top" Width="434" Click="btnPostAResponse_Click" />-->
            <TextBlock Height="49" FontSize="30" Style="{StaticResource PhoneTextBodyTextStyle}" HorizontalAlignment="Left" Margin="6,10,0,0" x:Name="tbPoints" Text="200" VerticalAlignment="Top" Width="103" />
            <TextBlock Height="34" Style="{StaticResource PhoneTextBodyTextStyle}" HorizontalAlignment="Left" Margin="6,44,0,0" x:Name="tbTotalVotes" Text="Total Votes" VerticalAlignment="Top" />
            <!--<th:VoteDownButton x:Name="btnVoteDown" Height="70" Width="74" VotePercentage="25" Margin="254,1,152,581" />
            <th:VoteUpButton x:Name="btnVoteUp" Height="70" Width="74" VotePercentage="75" Margin="179,1,227,581" />-->
            <!--<Canvas Height="70" HorizontalAlignment="Left" Margin="404,0,0,0" Name="button3" VerticalAlignment="Top" Width="74">
                <Canvas.Background>
                    <ImageBrush ImageSource="/NASA.BeAMartian;component/Icons/abuse.png"  Stretch="Fill"/>
                </Canvas.Background>

            </Canvas>
            <Canvas  Height="70" HorizontalAlignment="Left" Margin="330,0,0,0" Name="button4" VerticalAlignment="Top" Width="74">
                <Canvas.Background>
                    <ImageBrush ImageSource="NASA.BeAMartian;component/icons/Share.png"  Stretch="Fill"/>
                </Canvas.Background>
            </Canvas>-->
            <Image  Height="79" HorizontalAlignment="Left" Margin="13,123,0,0" x:Name="imgAvatar" Stretch="Fill" VerticalAlignment="Top" Width="79" Source="{Binding NuggetOriginator.Avatar}" />
            <TextBlock FontSize="20" Style="{StaticResource PhoneTextBodyTextStyle}" Height="29" HorizontalAlignment="Left" Margin="10,203,0,0" x:Name="tbQuestionPosterUsername" Text="{Binding NuggetOriginator.DisplayName}" VerticalAlignment="Top" Width="109" />
            <TextBlock FontSize="20" FontStyle="Italic" Height="29" HorizontalAlignment="Left" Margin="10,236,0,0" x:Name="tbQuestionPosterPoints" Style="{StaticResource PhoneTextBodyTextStyle}" Text="{Binding NuggetOriginator.UserReputationString}" VerticalAlignment="Top" Width="109" />
            <TextBlock Height="36" HorizontalAlignment="Left" Margin="46,297,0,0" x:Name="tbResponses" Style="{StaticResource PhoneTextBodyTextStyle}" Text="Responses" VerticalAlignment="Top" Width="120" />
            <Image Height="29" HorizontalAlignment="Left" Margin="11,300,0,0" x:Name="imgResponses" Stretch="Fill" 
                   VerticalAlignment="Top" Width="33" 
                   Source="/NASA.BeAMartian;component/Assets/Images/Response_White.png" />

            <ListBox Height="295" HorizontalAlignment="Left" Margin="10,334,0,0" x:Name="lbResponses" VerticalAlignment="Top" Width="462" ItemsSource="{Binding Items}"  Style="{StaticResource PhoneListBox}">
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <StackPanel Margin="2,2" VerticalAlignment="Top" Background="#FF1F1F1F">
                            <StackPanel Orientation="Horizontal">
                                <Image x:Name="imgResponseAvatar" HorizontalAlignment="Left"  Stretch="Fill" VerticalAlignment="Top" 
                                       Source="{Binding Originator.Avatar}"   />
                                <TextBlock Margin="12,0,0,0" Foreground="White" FontSize="18"  VerticalAlignment="Top" 
                                           Text="{Binding Body}" TextWrapping="Wrap" Width="359"/>
                            </StackPanel>
                            <StackPanel Orientation ="Horizontal" >

                                <TextBlock Foreground="White" FontSize="14" Text="{Binding Originator.DisplayName}" TextWrapping="Wrap" Height="23"/>
                                <TextBlock Text=" " />
                                <TextBlock Foreground="White" FontSize="14" Text="{Binding Originator.UserReputationString}" TextWrapping="Wrap" Height="23"/>
                            </StackPanel>

                        </StackPanel>
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>

        </Grid>
    </Grid>

</phone:PhoneApplicationPage>
